package com.baizhi.dao;

import com.baizhi.entity.Student;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

//dao接口继承的JpaRepository<Student,Integer>接口  要标明泛型
//前者student是指该dao接口对应的实体类类型  后面的Integer是指该实体类的id属性的类型
public interface StudentDao extends JpaRepository<Student,Integer> {
    List<Student> findByName(String name);
    List<Student> findByNameLike(String name);
    List<Student> findByNameContaining(String name);
    List<Student> findByNameAAndAge(String name,Integer age);
    //分页查询
    Page<Student> findAll(Pageable pageable);

}